<?php 
require_once 'init.php';
require_once 'ckLogin.php';
require_once 'dbClasses'.DIRECTORY_SEPARATOR.'config.php';
require_once 'dbClasses'.DIRECTORY_SEPARATOR.'dbConn.php';
$db = new dbConn();
//定义表名
define("TABLENAME","priceninepointnine");
define("TABLENAME1","admin");
define("TABLENAME2","category");
//提交处理
if(strtoupper($_SERVER['REQUEST_METHOD'])=='POST'){
	$contentID=$_POST['contentID'];
	$title = $_POST['title'];
	$desc=htmlspecialchars($_POST['description']);
	$updater_2 = $_POST['updater_2'];
	$originalPrice = $_POST['originalPrice'];
	$currentPrice = $_POST['currentPrice'];
	$goodsUrl = $_POST['goodsUrl'];
	//
	$publishDate = $_POST['publishDate'];
	$sort = $_POST['sort'];
	$picture = $_POST['taobao_item_img'];
	$saledNum = $_POST['saledNum']?$_POST['saledNum']:0;
	$commission = $_POST['commission'];
	//手动录入用1，根据id接口用2，默认2，9.9元为3
	$comefrom = 3;
	//新增
	$startTime = strtotime($_POST['startTime']);
	$endTime = strtotime($_POST['endTime']);
	
	if(empty($contentID)){
		$db->sql="INSERT INTO ".TABLENAME."(`desc`,updater,goodsUrl,title,originalPrice,currentPrice,picture,publishDate,sort,comefrom) VALUES('".$desc."' , '".$updater_2."' , '".$goodsUrl."' , '".$title."' , '".$originalPrice."' , '".$currentPrice."' , '".$picture."' , '".$publishDate."' ,'".$sort."' , ".$comefrom.")";
		$db->doExecute();
?>
	<script type="text/javascript">
		this.location.replace('insert9point9.php');
	</script>
<?php 
	}else{
		if($comefrom==3){
			$db->sql="UPDATE ".TABLENAME." SET `desc` = '".$desc."' , updater = '".$updater_2."' , goodsUrl = '".$goodsUrl."' , title = '".$title."' , originalPrice = '".$originalPrice."' , currentPrice = '".$currentPrice."' , publishDate = '".$publishDate."' , sort = ".$sort." , saledNum = ".$saledNum." , commission = ".$commission." , startTime = ".$startTime." , endTime = ".$endTime." WHERE id = ".$contentID;
			$db->doExecute();
			$db->sql="SELECT id,goodsID,updater,publishDate FROM ".TABLENAME." WHERE  id = {$contentID} ";
			$goodsInfo = $db->doResult2();
			//操作记录
			$db->sql = "INSERT INTO goodschange (changeid,`table`,goodsid,oldsaletime,operate,updater,changetime) VALUES({$contentID},'".TABLENAME."',{$goodsInfo['goodsID']},'{$goodsInfo["publishDate"]}','修改','{$_SESSION["userName"]}',".time().")";
			$db->doExecute();
		}else{
			die("失败的，没comefrom");
		}
		$db->sql="SELECT `status` FROM ".TABLENAME." WHERE id = ".$contentID;
		$status = $db->doResultOne();
		if($status==0){
?>
			<script type="text/javascript">
				this.location.replace('insert9point9.php');
			</script>
<?php 
		}
	}
	
}
//条件
$where = "WHERE p.`status`!=0 AND p.`isDel`!=1 ";
if(!empty($_GET['startTime']) || !empty($_GET['endTime']) || !empty($_GET['updater']) || !empty($_GET['cateid']) || !empty($_GET['goodsid'])){
	if(!empty($_GET['startTime'])) $where.= "AND p.publishDate>='".$_GET['startTime']."' ";
	if(!empty($_GET['endTime'])) $where.= "AND p.publishDate<='".$_GET['endTime']."' ";
	if(!empty($_GET['updater'])) $where.= "AND p.updater='".$_GET['updater']."' ";
	if(!empty($_GET['cateid'])) $where.= "AND c.id='".$_GET['cateid']."' ";
	if(!empty($_GET['goodsid'])) $where.= "AND p.goodsID='".$_GET['goodsid']."' ";
}
//排序publishDate Updater shared collected
if(!empty($_GET['sort'])){
	$sortarray = explode('_', $_GET['sort']);
	$order = "p.".$sortarray[0]." ".$sortarray[1].",";
}else{
	$order = '';
}
//总条数
$db->sql="SELECT count(p.id) count_id FROM ".TABLENAME." p LEFT JOIN ".TABLENAME2." c ON c.id = p.cateID ".$where;
$count = $db->doResultOne();
//分页
if(empty($_GET['page'])){$page = 1;}else{$page=$_GET['page'];}
if(empty($_GET['pagesize'])){$pagesize = PAGESIZE;}
else{$pagesize = $_GET['pagesize'];}
$pageInfo = page($count, $pagesize, $page);
$maxPage = $pageInfo['maxPage'];
$start = $pageInfo['start'];
$pages = $pageInfo['pages'];

$db->sql="SELECT p.*,a.nickName,c.cate FROM ".TABLENAME." p LEFT JOIN ".TABLENAME1." a ON p.updater = a.userName LEFT JOIN ".TABLENAME2." c ON c.id = p.cateID ".$where." ORDER BY ".$order." p.publishDate DESC,p.sort ASC LIMIT ".$start.",".$pagesize;
$pictures = $db->doResultList2();
//分类
$db->sql="SELECT * FROM category";
$category = $db->doResultList2();
//var_dump($pictures);die();
//url
$url= "?startTime=".$_GET['startTime']."&endTime=".$_GET['endTime']."&updater=".$_GET['updater']."&pagesize=".$_GET['pagesize']."&cateid=".$_GET['cateid']."&sort=".$_GET['sort'];
$url2="?startTime=".$_GET['startTime']."&endTime=".$_GET['endTime']."&updater=".$_GET['updater']."&pagesize=".$_GET['pagesize']."&cateid=".$_GET['cateid'];

$admins = getAdmin($db);
//var_dump($admins);
//用户列表
function getAdmin($db){
	$db->sql = "SELECT * FROM ".TABLENAME1." WHERE id != 1 AND type=2";
	return $admins = $db->doResultList2();
}
//分页
function page($total,$size,$page){
	//最大页数
	if($total%$size==0){
		$maxPage = $total/$size;
	}else{
		$maxPage = (int)($total/$size)+1;
	}
	//开始条数
	$start = ($page-1)*$size;
	//分页
	if($maxPage>=5){
		if($page<=2){
			$pages=array(1,2,3,4,5);
		}elseif($page>=($maxPage-1)){
			$pages=array($maxPage-4,$maxPage-3,$maxPage-2,$maxPage-1,$maxPage);
		}else{
			$pages=array($page-2,$page-1,$page,$page+1,$page+2);
		}
	}else{
		for($i=1;$i<=$maxPage;$i++){
			$pages[]=$i;
		}
	}
	if($page<=1){$previous=1;}else{$previous=$page-1;} 
	if($page>=$maxPage) {$next = $maxPage;}else{ $next = $page+1;}
	return array('maxPage'=>$maxPage,'start'=>$start,'pages'=>$pages,'previous'=>$previous,'next'=>$next);
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Simpla Admin</title>
<!--                       CSS                       -->
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="resources/css/reset.css" type="text/css"
	media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="resources/css/main.css" type="text/css"
	media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="resources/css/invalid.css" type="text/css"
	media="screen" />
<!-- Colour Schemes
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		<link rel="stylesheet" href="resources/css/blue.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="resources/css/red.css" type="text/css" media="screen" />  
		-->
<!-- Internet Explorer Fixes Stylesheet -->
<!--[if lte IE 7]>
			<link rel="stylesheet" href="resources/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
<!--                       Javascripts                       -->
<!-- jQuery -->
<script type="text/javascript" src="resources/scripts/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
$(function($) {
	$(".editbutton").click(function(){
		$("#pic_id").val($(this).data('id'));
		//获取描述
		$.ajax({
			   type: "GET",
			   url: "youpinAjax.php",
			   data: "act=NPNListEdit&id="+$(this).data('id'),
			   dataType: "json",
			   success: function(date){
				   //alert( $("#cate_id2").val());
				   $("#contentID").val(date.id);
				   $('#updater_2 option:selected').attr("selected",false);
				   $("#description").html(date.desc);
				   $("#title").val(date.title);
				   $("#goodsUrl").val(date.goodsUrl);
				   $("#updater_2").val(date.updater);
				   $("#originalPrice").val(date.originalPrice); //
				   $("#currentPrice").val(date.currentPrice);
				   $("#comefrom").val(date.comefrom);
				   $("#sort").val(date.sort);
				   $("#publishDate").val(date.publishDate);
				   $("#cate-option-"+date.cateID).attr("selected","selected");
				   $("#update-option-"+date.aid).attr("selected","selected");
				   $("#saledNum").val(date.saledNum);
				   $("#commission").val(date.commission);
				   $("#startTime").val(date.startTime1);
				   $("#endTime").val(date.endTime1);
				   $("#message_click").click();
			   }
		});
		
	});
	$(".delbutton").click(function(){ 
		//alert($(this).data("id"));
		if(confirm('你确定要删除该9.9元商品！')){
			//alert($(this).parent().parent().children("td:eq(1)").text());
			//删除数据
			$.ajax({
				   type: "GET",
				   url: "youpinAjax.php",
				   data: "id="+$(this).data("id")+"&act=ninePointNineDel",
				   async: false,
				   success: function(){
						//alert('删除成功');
					}
			} );
			$("tbody tr:eq("+$(this).parent().parent().index()+")").remove();
		}
	});
	//商品上下架
	$(".isSalebutton").click(function(){
		var _this = $(this);
		var id = _this.data("id");
		var status = _this.data("status");
		if(status==1) {var word = "是否下架该商品？";}
		if(status==2) {var word = "是否上架该商品？";}
		//alert(id);return false;
		if(confirm(word)){
			$.ajax({
				type: "GET",
				url: "youpinAjax.php",
				data: "id="+id+"&act=isSale&table=priceninepointnine&",
				dataType: "html",
				success: function(rs){
					if(rs==1) {_this.text("上架中");alert("上架成功！！");};
					if(rs==2) {_this.text("下架中");alert("下架成功！！");};
					_this.data("status",rs);
				}
			});
		}
	});
	//多数据操作
	$(".xiugai").click(function(){
		//alert($("#caozuo option:selected").val());
			var text="";  
	        $("input[name=picSel]").each(function() {  
	            if ($(this).attr("checked")) {  
	                text += ","+$(this).val();  
	            }  
	        });
	        //alert(text);
	        window.location.replace('moreEdit.php?ids='+text);
		
	});
	//导出
	$("#download").click(function(){
		var startTime = $('#startTime_1').val();
		var endTime   = $('#endTime_1').val();
		if(startTime && endTime){
			if(startTime > endTime){
				alert('开始时间大于结束时间');
				return false;
			}else{
				window.open('downloadExcel3.php?startTime='+startTime+'&endTime='+endTime);
			}
		}else{
			alert("时间不能为空");
			return false;
		}
	});

	$(".plsc9p9").click(function(){
		if(confirm("是否删除这些商品！")){
			var ids='';
			$("input[name=picSel]:checked").each(function() {
				ids+=$(this).val()+',';
				$(this).parents("tr").remove();
			});
			$.ajax({
				type: "GET",
				url: "youpinAjax.php",
				data: "ids="+ids+"&act=plsc9p9",
				dataType: "html",
				success: function(date){
					//alert(date);
					
				}
			});
			//alert(ids);
		}
	});
});

</script>

<!-- jQuery Configuration -->
<script type="text/javascript" src="resources/scripts/simpla.jquery.configuration.js"></script>
<!-- Facebox jQuery Plugin -->
<script type="text/javascript" src="resources/scripts/facebox.js"></script>
<!-- jQuery WYSIWYG Plugin -->
<script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
<!-- jQuery my97datepicker -->
<script type="text/javascript" src="resources/scripts/My97DatePicker/WdatePicker.js"></script>
<!-- jQuery colorbox -->
<link rel="stylesheet" href="resources/css/colorbox.css" />
<script src="resources/scripts/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
$(function($) {
	$(".group-pic").colorbox({rel:'group-pic',width:"50%", height:"75%"});
});
</script>
</head>
<body>
	<div id="body-wrapper">
		<!-- Wrapper for the radial gradient background -->
		<a href="#messages" rel="modal" id="message_click"></a>
		<div id="messages" style="display: none;">
			<!-- Messages are shown when a link with these attributes are clicked: href="#messages" rel="modal"  -->

			<p style="">
				<strong>简短描述输入及修改</strong>
			</p>
			<form action="<?php echo $url."&page=".$page;?>" method="post">
				<fieldset>
					责任编辑：
					<select id="updater_2" name="updater_2" style="width: 300px;">
						<option value="" ></option>
						<?php foreach ($admins as $keyX=>$itemX):?>
						<option id="update-option-<?php echo $itemX['id'];?>" value="<?php echo $itemX['userName'];?>" <?php if($_SESSION['userName']==$itemX['userName']):?>selected="selected"<?php endif;?> ><?php echo $itemX['nickName'];?></option>
						<?php endforeach;?>
					</select><br />
					地址：
					<input class="text-input " type="text" id="goodsUrl" name="goodsUrl" style="width: 310px;"/><br />
					名称：
					<input class="text-input " type="text" id="title" name="title" style="width: 310px;"/><br />
					原价：
					<input class="text-input " type="text" id="originalPrice" name="originalPrice" style="width: 60px;"/>
					现价：
					<input class="text-input " type="text" id="currentPrice" name="currentPrice" style="width: 60px;"/>
					佣金：
					<input class="text-input " type="text" id="commission" name="commission" style="width: 60px;"/>%<br />
					描述：
					<textarea class="textarea" id="description" name="description" cols="79" rows="5"></textarea>
					发布日期：
					<input class="text-input " type="text" id="publishDate" name="publishDate" onClick="WdatePicker()"/><br />
					开始时间：
					<input class="text-input " type="text" id="startTime" name="startTime" value="" onClick="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/> <br />
					结束时间：
					<input class="text-input " type="text" id="endTime" name="endTime" value="" onClick="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/><br />
					商品排序：
					<input class="text-input " type="text" id="sort" name="sort" value="1" style="width: 105px;"/> 
					已售数量：
					<input class="text-input " type="text" id="saledNum" name="saledNum" value="" style="width: 105px;"/><br />
					<span id="taobao_img_span">
					</span>
					
					<input id="contentID" name="contentID" type="hidden" value="" />
					<input id="comefrom" name="comefrom" type="hidden" value="" />
					
					<input class="button" type="submit" value="修改" /> 
					<a href="javascript:void(0);" onclick="$(this).parents('#facebox').hide();">关闭</a>
				</fieldset>
			</form>
		</div>
		<!-- End #messages -->
		<div id="main-content">
			<!-- Main Content Section with everything -->
			<!-- Page Head -->
			<h2>欢迎使用<?php echo APPLICATION;?>管理后台</h2>
			<p id="page-intro">接下来你要做什么呢亲？</p>
			<div class="clear"></div>
			<!-- End .clear -->
			<div class="content-box">
				<!-- Start Content Box -->
				<div class="content-box-header">
					<h3><?php echo WHAT;?>列表</h3>
					<!-- <ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">Table</a></li>
						href must be unique and match the id of target div
						<li><a href="#tab2">Forms</a></li>
					</ul> -->
					<div class="clear"></div>
				</div>
				<!-- End .content-box-header -->
				<div class="content-box-content">
					<form method="get" action="">
						商品ID：<input type="text" id="goodsid" name="goodsid" value="<?php echo $_GET['goodsid'];?>" size="12"/> 
						时间：
						<input type="text" id="startTime_1" name="startTime" onClick="WdatePicker()" value="<?php echo $_GET['startTime'];?>" size="10"/> 
						-
						<input type="text" id="endTime_1" name="endTime" onClick="WdatePicker()" value="<?php echo $_GET['endTime'];?>" size="10"/>
						&nbsp;&nbsp;&nbsp;责任编辑：
						<select name="updater" style="">
							<option value="" ></option>
							<?php foreach ($admins as $keyX=>$itemX):?>
							<option id="" value="<?php echo $itemX['userName'];?>" <?php if($_GET['updater']==$itemX['userName']) echo 'selected="selected"';?>><?php echo $itemX['nickName'];?></option>
							<?php endforeach;?>
						</select>
						&nbsp;&nbsp;&nbsp;
						每页<input name="pagesize" type="text" size="2" value="<?php echo $pagesize;?>"/>条
						&nbsp;&nbsp;&nbsp;
						<button class="button" id="zhixing" type="submit">搜索</button>
						<button class="button" id="download" type="submit">导出以做优品9.9资源</button>
						<input type="hidden" name="page" value="<?php echo $page;?>"/>
						<input type="hidden" name="cateid" value="<?php echo $_GET['cateid'];?>"/>
						
					</form>
					
					<hr />
					<div class="clear"></div>
					<div class="tab-content default-tab" id="tab1">
						<!-- This is the target div. id must match the href of this div's tab -->

						<table>
							<thead>
								<tr>
									<td colspan="16">
										<div class="bulk-actions align-left">
											<!-- <button class="button xiugai" >修改</button>
											<button class="button shanchu" >删除</button> -->
											<button class="button plsc9p9" >批量删除</button>
										</div> 
										<?php if($maxPage>0):?>
										<div class="pagination">
											<a href="<?php echo $url;?>&page=1" title="First Page">&laquo; First</a>
											<a href="<?php echo $url."&page=".$pageInfo['previous'];?>" title="Previous Page">&laquo; Previous</a>
											<?php foreach ($pages as $item):?> 
											<a href="<?php echo $url."&page=".$item;?>" class="number <?php if($item == $page) echo 'current';?>" title="<?php echo $item;?>"><?php echo $item;?></a>
											<?php endforeach;?>
											<a href="<?php echo $url."&page=".$pageInfo['next'];?>" title="Next Page">Next &raquo;</a>
											<a href="<?php echo $url."&page=".$maxPage;?>" title="Last Page">Last &raquo;</a>
											total : <?php echo $maxPage;?>
										</div> 
										<?php endif;?>
										<!-- End .pagination -->
										<hr class="clear" />
										<!--  分类：<?php foreach ($category as $item):?>&nbsp;&nbsp;&nbsp;
												<a href="?cateid=<?php echo $item['id'];?>"><?php echo $item['cate'];?></a>
											<?php endforeach;?>-->
									</td>
								</tr>
							</thead>
							<thead>
								<tr>
									<th><input class="check-all" type="checkbox" /></th>
									<th>编号</th>
									<th>图片</th>
									<th>
										日期<br /><span ><a href="<?php echo $url2."&page=".$page;?>&sort=publishDate_asc">
											<?php if($_GET['sort'] == "publishDate_asc"):?><img src="resources/images/sort3.png" />
											<?php else:?><img src="resources/images/sort1.png" /><?php endif;?>
											</a>
											<a href="<?php echo $url2."&page=".$page;?>&sort=publishDate_desc">
											<?php if($_GET['sort'] == "publishDate_desc"):?><img src="resources/images/sort4.png" />
											<?php else:?><img src="resources/images/sort2.png" /><?php endif;?>
											</a>
										</span>
									</th>
									<th style="width: 10%;">标题</th>
									<th style="width: 10%;">描述</th>
									<th style="width: 10%;" class="taobao_url_css">地址</th>
									<th style="width: 6%;">原价</th>
									<th style="width: 6%;">现价</th>
									<th style="width: 6%;">佣金</th>
									<th>责任编辑<br /><span ><a href="<?php echo $url2."&page=".$page;?>&sort=updater_asc">
											<?php if($_GET['sort'] == "updater_asc"):?><img src="resources/images/sort3.png" />
											<?php else:?><img src="resources/images/sort1.png" /><?php endif;?>
											</a>
											<a href="<?php echo $url2."&page=".$page;?>&sort=updater_desc">
											<?php if($_GET['sort'] == "updater_desc"):?><img src="resources/images/sort4.png" />
											<?php else:?><img src="resources/images/sort2.png" /><?php endif;?>
											</a>
									</span></th>
									<th style="width: 64px;">开始<br />时间</th>
									<th style="width: 64px;">结束<br />时间</th>
									<th>排序</th>
									<th>已售</th>
									<th>操作</th>
								</tr>

							</thead>

							<tbody>
							<?php if(count($pictures)>0):?>
							<?php foreach ($pictures as $key=>$item):?>
								<tr>
									<td><input type="checkbox" name="picSel" value="<?php echo $item['id'];?>"/></td>
									<td><?php echo $item['id'];?></td>
									<td>
										<p><a class="group-pic" href="<?php if($item['comefrom']==2) echo $item['picture'];else echo '../'.$item['picture'];?>" title="<?php echo $item['title'];?>">
											<img src="<?php if($item['comefrom']==2) echo $item['picture'];else echo '../'.$item['picture'];?>" alt="" width="50px;" height="50px;"/>
										</a></p>
									</td>
									<td><?php echo $item['publishDate'];?></td>
									<td><?php echo $item['title'];?></td>
									<td><?php echo $item['desc'];?></td>
									<td><?php echo $item['goodsUrl'];?></td>
									<td><?php echo $item['originalPrice'];?></td>
									<td><?php echo $item['currentPrice'];?></td>
									<td><?php if(!empty($item['commission'])) echo '<span>'.$item['commission'].'</span>%';?></td>
									<td><?php echo isset($item['nickName'])?$item['nickName']:$item['updater'];?></td>
									<td><?php echo date("Y-m-d H:i:s",$item['startTime']);?></td>
									<td><?php echo date("Y-m-d H:i:s",$item['endTime']);?></td>
									<td><?php echo $item['sort'];?></td>
									<td><?php echo $item['saledNum'];?></td>
									<td>
										<!-- Icons --> 
										<a  title="Edit" class="editbutton" data-id="<?php echo $item['id'];?>" style="cursor: pointer;">修改</a> <br /><br />
										<a  title="Delete" class="delbutton" data-id="<?php echo $item['id'];?>" style="cursor: pointer;">删除</a><br /><br />
										<a  title="Sale" class="isSalebutton" data-id="<?php echo $item['id'];?>" data-status=<?php echo $item['status'];?> style="cursor: pointer;"><?php if($item['status']==1) echo '上架中';if($item['status']==2) echo '下架中';?></a> 
										<!-- <a href="#" title="Edit Meta"><img src="resources/images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a> -->
									</td>
								</tr>
							<?php endforeach;?>
							<?php else:?>
								<tr style="font-size: 50px;text-align: center; font-weight: bold;"><td colspan="9" style="text-align: center;">没有<?php echo WHAT;?></td></tr>
							<?php endif;?>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="16">
										<div class="bulk-actions align-left">
											<!-- <button class="button xiugai" >修改</button>
											<button class="button shanchu" >删除</button> -->
											<button class="button plsc9p9" >批量删除</button>
										</div>
										<?php if($maxPage>0):?>
										<div class="pagination">
											<a href="<?php echo $url;?>&page=1" title="First Page">&laquo; First</a>
											<a href="<?php echo $url."&page=".$pageInfo['previous'];?>" title="Previous Page">&laquo; Previous</a>
											<?php foreach ($pages as $item):?> 
											<a href="<?php echo $url."&page=".$item;?>" class="number <?php if($item == $page) echo 'current';?>" title="<?php echo $item;?>"><?php echo $item;?></a>
											<?php endforeach;?>
											<a href="<?php echo $url."&page=".$pageInfo['next'];?>" title="Next Page">Next &raquo;</a>
											<a href="<?php echo $url."&page=".$maxPage;?>" title="Last Page">Last &raquo;</a>
											total : <?php echo $maxPage;?>
										</div> 
										<?php endif;?>
										<!-- End .pagination -->
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>

						</table>

					</div>
					<!-- End #tab1 -->


				</div>
				<!-- End .content-box-content -->

			</div>
			<!-- End .content-box -->

			<div class="clear"></div>

			<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
					&#169; Copyright 2009 Your Company | Powered by <a href="http://themeforest.net/item/simpla-admin-flexible-user-friendly-admin-skin/46073">Simpla
						Admin</a> | <a href="#">Top</a>
				</small>
			</div>
			<!-- End #footer -->

		</div>
		<!-- End #main-content -->

	</div>
</body>


<!-- Download From www.exet.tk-->
</html>
